import axios from "axios";

const uploadHttp = axios.create({
    baseURL: "",
    timeout: 500000,
    withCredentials: true,
    headers: {
        'Content-Type': 'multipart/form-data',
        'Access-Control-Allow-Origin': '*',
    }
})

uploadHttp.interceptors.request.use(config => {
    console.log(config.data)
    return config
})

uploadHttp.interceptors.response.use(response => {
    console.log(response.data)
    return response.data
}, err => {
    return Promise.reject(err)
})

export default uploadHttp

export const baseUploadHeaders = () => {
    return {
        headers: {
            'Content-Type': 'multipart/form-data',
            'Access-Control-Allow-Origin': '*',
        }
    };
};
